package com.mysiteforme.admin.base.param;
/**
 * @author
 * Created by heqichao on 2018-2-14.
 */

public class ResponeResult {

    private boolean isSuccess =true;

    private String message="";

    private Integer code=20000;

    private Object data=new Object();

    public ResponeResult() {
        this.isSuccess = true;
    }


//    private Object data=new Object();



    public ResponeResult(boolean isSuccess, String message, Object data,Integer code) {
        this.isSuccess = isSuccess;
        this.message = message;
        this.data = data;
        this.code = code;
    }

    public ResponeResult(boolean isSuccess, String message, Object data) {
        this.isSuccess = isSuccess;
        this.message = message;
        this.data = data;
    }



    public ResponeResult(boolean isSuccess, String message) {
        this.isSuccess = isSuccess;
        this.message = message;
    }

    public ResponeResult( Object data) {
        this.isSuccess =true;
        this.data = data;
    }


    public ResponeResult( Object data,Integer code) {
        this.isSuccess =true;
        this.data = data;
        this.code = code;
//        this.data = data;
    }

    public boolean isSuccess() {
        return isSuccess;
    }

    public void setSuccess(boolean success) {
        isSuccess = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

//    public Object getData() {
//        return data;
//    }
//
//    public void setData(Object data) {
//        this.data = data;
//    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void success(Object data){
        this.isSuccess = true;
        this.data = data;
    }

    public void error(Object data){
        this.isSuccess = false;
        this.data = data;
    }

    public void errorMsg(String message){
        this.isSuccess = false;
        this.message = message;
    }

    public void errorMsg(String message,Integer code){
        this.isSuccess = false;
        this.message = message;
        this.code = code;

    }
}
